<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>splice</title>
</head>
<body>
	<script type="text/javascript">
			var a=[1,2,3,4,5,6,7,8,9],b=[];
			//删除。
			b=a.splice(4,5);
			console.log(b);//5,6,7,8,9
			console.log(a); //1,2,3,4

			// //插入。增加新的元素,在3 后插入a,b,c,
			// b=a.splice(3,0,"a","b","c");
			// console.log(a);
			// console.log(b);hQ32	aaaaO

			// //替换。 345替换成abc
			// b=a.splice(2,3,"a","b","c");
			// console.log(a);
			// console.log(b);


	</script>
</body>
</html>